package cn.yuan.data.controller;

import cn.common.result.Response;
import cn.model.Entrust;
import cn.yuan.data.service.EntrustService;

import com.yuan.security.annotation.RequiresLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/entrust")
public class EntrustController {

     @Autowired
     private EntrustService entrustService;
      @RequiresLogin
      @PostMapping("/setEntrust")
      public Response setEntrust(@RequestBody Entrust entrust){
           return Response.Success(entrustService.setEntrust(entrust));
       }

       //获取历史记录
    @RequiresLogin
    @GetMapping("/getHistoryEntrust")
    public Response getHistoryEntrust(String pairsName){
          return Response.Success(entrustService.getHistoryEntrust(pairsName));
    }
}
